<?php 
	
class sponsorise {
	
	private $idPilote ;   
	private $idSponsor;

	
	public function __construct()
	{
		$this->db = new myPdo ;
		$req="set names 'UTF8'";
		$this->db->exec($req);
	}
	
	// SETTEURS

	public function setIdPilote($idPilote) 
	{
		$this->idPilote = $idPilote ;
	}
	public function setIdSponsor($idSponsor) 
	{
		$this->idSponsor = $idSponsor  ;
	}
	
	
	
	// GETTEURS
	public function getIdPilote() 
	{
		return $this->idPilote;
	}
	public function getIdSponsor() 
	{
		return $this->idSponsor;
	}

	
	
	
	
	public function getAllSponsors()
	{
		$r = "SELECT * FROM sponsorise WHERE PILNUM = '$this->idPilote' ; " ;
		$resu = $this->db->query($r) ;
		$tablo = null ;
		while ($ligne = $resu->fetch(PDO::FETCH_OBJ))
		{
			$tablo[] = $ligne ;
		}
		return $tablo ;
	}
	
	
}
?>